import wsgiref.handlers
from punch import PunchEntity 
from punch import Punch
from view import ViewHTML
from view import ViewXML

from google.appengine.ext import webapp

class MainPage(webapp.RequestHandler):
    def get(self):
        self.response.headers['Content-Type'] = 'text/html'
        self.response.out.write('''
<html>
<h2>Earlybird Technology Punch Card</h2>
<a href="./punch">Record Efforts</a><br>
<a href="./view_html">View my Punchcard</a>
</html>''')


def main():
    application = webapp.WSGIApplication(
                                         [('/', MainPage),
                                          ('/punch', Punch),
                                          ('/view_html', ViewHTML),
                                          ('/view_xml', ViewXML),
                                          ],
                                          debug=False)
    wsgiref.handlers.CGIHandler().run(application)

if __name__ == "__main__":
    main()
